-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fixture to skip test if jax is not present #1066
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1066 +/- ##
=======================================
Coverage 97.74% 97.74%
=======================================
Files 153 153
Lines 11579 11579
=======================================
Hits 11318 11318
Misses 261 261 ☔ View full report in Codecov by Sentry. |
@pytest.fixture | ||
def skip_if_no_jax_support(): | ||
pytest.importorskip("jax") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that this is simpler, but should we instead match the import pattern used for Torch and TF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above were written when I did not know of the existence of importorskip
. I think this is simpler, and happy for the above to be rewritten to match.
Co-authored-by: Josh Izaac <josh146@gmail.com>
* PR 1082 * PR 1072 * Update vqe.py (#1077) update `genearate_hamiltonian` refs * PR 1074 * Add jax skip (#1066) Co-authored-by: Josh Izaac <josh146@gmail.com> * update changelog * update version number * Apply suggestions from code review Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com> Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
* PR 1082 * PR 1072 * Update vqe.py (#1077) update `genearate_hamiltonian` refs * PR 1074 * Add jax skip (#1066) Co-authored-by: Josh Izaac <josh146@gmail.com> * update changelog * update version number * Update .github/CHANGELOG.md Co-authored-by: antalszava <antalszava@gmail.com> Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
I noticed some tests were failing locally for me (without
jax
installed). I should installjax
, but in case anyone else hasn't got it installed, this PR will make sure their tests don't fail.